package test.designmode.buttonlistener3;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by shuoGG on 2018/8/10
 */
public class EventHandler {
    private List<Handler> handlerList = new ArrayList<>();

    public void addHandler(Object obj, String method, Object... arg) {
        handlerList.add(new Handler(obj, method, arg));
    }

    public void invokeAll() throws Exception {
        for (Handler handler : handlerList) {
            handler.invoke();
        }
    }
}
